package com.itshen.entity;

import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

/**
 * @author stephen
 */
@Data
@Document(indexName = "city_index", type = "city", shards = 1,replicas = 0, refreshInterval = "-1")
public class City {

    /**
     * 城市编号
     */
    @Id
    private Long id;

    /**
     * 省份编号
     */
    @Field(type = FieldType.Long)
    private Long provinceId;

    /**
     * 城市名称
     * Keyword注解作用：不分词，查ES的时候，就是精确查找
     */
    @Field(type = FieldType.keyword)
    private String cityName;

    /**
     * 描述
     */
    @Field(type = FieldType.text, analyzer = "ik_max_word")
    private String description;
}
